d = int(input())
a = input().strip()
n = len(a)

dp = [float('inf')] * n
dp[0] = 0
for i in range(1, n):
    if a[i] == '-':
         continue
    # 遍历所有可能的前一个落脚点
    for j in range(max(0, i - d), i):
        # 检查 j 是否是尖刺，并且是否可以从 j 到达
        if a[j] == '+' and dp[j] != float('inf'):
             dp[i] = min(dp[i], dp[j] + 1)

print(dp[-1] if dp[-1] != float('inf') else -1)
